#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

int main(int argc, char const *argv[])
{
        if(argc != 2){
                printf("./a.out file name\n");
                return -1;
        }

        int fd = open(argv[1], O_RDWR | O_CREAT, 0666);

        int ret = lseek(fd, 1024-1, SEEK_END);
        //需要至少写一次,否则不能保存 就不能扩展
        write(fd, "a",  1);

        close(fd);

        return 0;
}
